{include file=header.html}
        <link href="{lib file=jquery.ui.1.10.2/css/ui-lightness/jquery-ui-1.10.2.custom.css}" rel="stylesheet">
       <script type="text/javascript" language="javascript" src="{lib file=jquery-1.6.3.min.js}"></script>
       <script language="javascript" type="text/javascript" src="{lib file=jquery.ui.1.10.2/js/jquery-ui-1.10.2.custom.js}"></script>
		<script language="javascript" type="text/javascript" src="{res file=js/factory_quote.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=ajaxfileupload.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/jquery.funkyUI.js}"></script>
        <link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
        <script language="javascript" type="text/javascript" src="{res file=js/select.js}"></script>
       	<script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
		<script language="javascript" type="text/javascript" src="{lib file=ecmall.js}"></script>
        <style>
            label.error {color:red;}
			.center {text-align:center;}
			tr.fabric_info_list td input{width:100%;height:100%;}
			.btn-2{margin-bottom:5px;}
			input{margin-right:5px;}
            .input-1 {line-height:18px;width:158px;}
			 .select-1 {line-height:18px;width:160px;}

        </style>
    </head>
<script type="text/javascript">
function assign_obj(){
	var url="index.php?app=merchant&act=assign_obj&md_id={$merch.md_id}";
	location.href=url;
}
function email_list(){
	var url="index.php?app=merchant&act=view_email&md_id={$merch.md_id}";
	location.href=url;
}
</script>
<body>
<div class="sub-body" >
	<h3 class="title-1" style="width:900px;"><span>面料需求</span></h3>
    <div class="tab-frame">
		<form method="post" name="fabric_add_form" id="fabric_add_form" onsubmit="return check_create_demand()" style="width:900px;">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
            	<th align="right" width="15%">日期：</th>
            	<td align="left">{$merch.demand_time|date:Y-m-d}</td>
            </tr>
            </tr>
            <!-- {if $merch.demand_sn} -->
            <tr>
            	<th align="right" width="15%">需求编号：</th>
            	<td align="left">{$merch.demand_sn|escape}</td>
            </tr>
            <!-- {/if} -->
            <!-- {if $user.role neq USER_MERCHANT} -->
            <tr>
            	<th align="right" width="15%">分配对象：</th>
            	<td align="left"><input type="button" value="分配对象" class="btn-1" onclick="assign_obj()" {if $merch.demand_status==3}disabled="disabled"{/if} /></td>
            </tr>
            <!-- {/if} -->
            <!-- {if $is_order} -->
            <tr>
            	<th align="right" width="15%">订单号：</th>
            	<td align="left">{$merch.order_sn|escape}</td>
            </tr>
            <!-- {else} -->
            <tr>
            	<th align="right" width="15%">板号：</th>
            	<td align="left">{$merch.sample_sn|escape}</td>
            </tr>
            <!-- {/if} -->
            <tr>
            	<th align="right" width="15%">需求描述：</th>
            	<td align="left"><textarea name="demand_descrption" rows="5" cols="110">{$merch.demand_descrption}</textarea></td>
            </tr>
            <tr>
            	<th align="right" width="15%">参考图片：</th>
            	<td align="left">
            		<input  type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_ref_img},{$merch.md_id|default:$default_key_id});" {if $merch.demand_status}{if $merch.demand_status!=1 || $user.role eq USER_MERCHANT} disabled="disabled"{/if}{/if} />
            		<div id="ref_img">
		                <!--{foreach from=$merch.ref_merch item=file}-->
						<span><a href="download.php?id={$file.file_id}" ><img src="{$file.file_path}" width="<!-- {if $user.role==USER_MERCHANT} -->500px<!-- {else} -->80px<!-- {/if} -->" height="<!-- {if $user.role==USER_MERCHANT} -->320px<!-- {else} -->50px<!-- {/if} -->" title="{$file.file_name}" /></a>
							<!-- {if ($user.role==USER_MERCHANDISER || $user.role==USER_CLIENT) && ($merch.demand_status==1)} -->
		               		<a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
		               		<!-- {/if} -->
		                </span>
						&nbsp;&nbsp;<!--{if !$smarty.foreach.last}--><!--{/if}--><!--{/foreach}-->
	                </div>
            	</td>
            </tr>
            <tr>
            	<th align="right" width="15%">推荐色卡：</th>
            	<td align="left">
            		<input  type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_recomm_color},{$merch.md_id|default:$default_key_id});" {if $merch.demand_status!=2 || $user.role neq USER_MERCHANT} disabled="disabled"{/if} />
            		<div id="demand_recomm_file">
		                <!--{foreach from=$merch.recomm_merch item=file}-->
						<span><a href="download.php?id={$file.file_id}" ><img src="{$file.file_path}" width="80px" height="50px" title="{$file.file_name}" /></a>
							<!-- {if ($user.role==USER_MERCHANT) && ($merch.demand_status==2)} -->
		               		<a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
		               		<!-- {/if} -->
		                </span>
						&nbsp;&nbsp;<!--{if !$smarty.foreach.last}--><!--{/if}--><!--{/foreach}-->
	                </div>
            	</td>
            </tr>
            <tr>
				<td colspan="2" align="center">
				<!-- {if $user.role==USER_MERCHANDISER && ($merch.demand_status!=2 && $merch.demand_status!=3)} -->
				 <input type="submit" name="sub_val" value="提交审批" id="submit" class="btn-2" onclick="if(confirm('您确定提交审批吗？提交后请分配对象！')!=true){return false;}" />
                 <!-- {/if} -->
                 <!-- {if ($user.role==USER_MERCHANDISER_ADMIN || $user.role==USER_MANAGER) && $merch.demand_status==1} -->
                  <input type="submit" name="sub_val" value="审批通过" id="submit" class="btn-2" onclick="if(confirm('您确定审批通过吗？')!=true){return false;}" />
                 <!-- {/if} -->
                 <input type="button" class="btn-2" value="返回" onclick="history.back();" />
                 {if $merch.md_id}
				 <!-- {if ($user.role!=USER_FACTORY && $user.role!=USER_MERCHANT)}-->
                 <input type="button" class="btn-2" value="邮箱列表" onclick="email_list();" />
				 <!-- {/if} -->
                 {/if}
				</td>
			</tr>
		</table>
		</form>
	</div>
</div>
<script type="text/javascript" language="javascript" src="{res file=js/tab_color.js}"></script>
</body>
{$async_sendmail}
</html>